package top.wshape1.shiziapi.search.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.wshape1.shiziapi.common.domain.ProjectSearch;

import java.util.List;

/**
 * @author Wshape1
 * @version 1.0
 * @description
 * @since 2023-11-28
 */


@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@NoArgsConstructor
@AllArgsConstructor
public class ProjectSearchPage {

    private long currentPage;

    private long totalPage;

    private long pageSize;

    private long total;


    private List<ProjectSearch> projectSearchList;

    public ProjectSearchPage(long currentPage, long pageSize, long total, List<ProjectSearch> projectSearchList) {
        this.projectSearchList = projectSearchList;
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.total = total;
        this.totalPage = total % pageSize == 0 ? total / pageSize : total / pageSize + 1;
    }


}
